/*
 * @Author: 哈哈 8300395+xue-guangxu@user.noreply.gitee.com
 * @Date: 2022-06-10 20:36:04
 * @LastEditors: 哈哈 8300395+xue-guangxu@user.noreply.gitee.com
 * @LastEditTime: 2022-06-12 12:12:50
 * @FilePath: \移动开发\day04\实验四.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/*function jie(a){
    if(a==1)
        return 1
    else
        return a*jie(a-1)
}
console.log(jie(10));*/



/*function jie(a){
    var s=1;
    var i=1;
    for(i=1;i<=10;i++){
        s=s*i;
    }
    return s;

}
console.log(jie(10));*/




/*function su(){
    var t;
    for(var i=101;i<=200;i++){
        t=1;
        for(var j=2;j<=i-1;j++){
            if(i%j==0){
                t=0;
                break;
            }
        }
        if(t==1)
            console.log(i)
    }
}
console.log(su())*/

/*function print(){
    var str="";
    for(var i=1;i<=9;i++){
        for(var j=1;j<=i;j++)
            str+=+j+"x"+i+"="+i*j+" ";
        str=str+"\n";
    }
    return str;   
}
console.log(print());*/

/*function print(){
    var i=9
    var str="";
    while(i>=1){
        var j=1;
        while(j<=i){
            str+=+j+"x"+i+"="+i*j+" ";
            j++;
        }
        str=str+"\n";
        i--
    }
    return str;
}
console.log(print());*/

function print(){
    var str="";
    for(var i=1;i<=9;i++){
        if(i==4||i==2)
            str=str+" ";
        if(i==3)
            str=str+"  ";
        for(var k=1;k<=9-i;k++){
            str=str+"       ";
        }
        for(var j=1;j<=i;j++)
            str+=+j+"x"+i+"="+i*j+" ";
        str=str+"\n";
    }
    return str;
}
console.log(print());

